package com.pub.proxy;

import java.net.Proxy;
import java.net.SocketAddress;


public class ProxyElement extends Proxy implements Comparable<ProxyElement>
{
	public ProxyElement(Type type, SocketAddress sa) 
	{
		super(type, sa);
	}

	private int id				= 0;
	private int validCount 		= 0;
	private int invalidCount 	= 0;
	
	private int port;
	
	private String host;
	
	public int getID()
	{
		return id;
	}
	
	public void setID(int id)
	{
		this.id = id;
	}
	
	public int getValidCount()
	{
		return validCount;
	}
	
	public void setValid()
	{
		validCount++;
	}
	
	public int getInvalidCount()
	{
		return invalidCount;
	}
	
	public void setInvalid()
	{
		invalidCount++;
	}
	
	public String getHost() 
	{
		return host;
	}
	
	public void setHost(String host) 
	{
		this.host = host;
	}
	
	public int getPort() 
	{
		return port;
	}
	
	public void setPort(int port) 
	{
		this.port = port;
	}

	@Override
	public int compareTo(ProxyElement obData) 
	{
		if(this.validCount > obData.validCount)
			return 1;
		else if (this.validCount < obData.validCount)
			return -1;
		else
			return 0;
	}
}
